# compiler settings
CXX = g++
CXXFLAGS = -Wall -std=c++20 -fdiagnostics-color=always

# target file
TARGET = main

# source code files
Sources = main.cpp LinkedNode.cpp MutableArrayContainer.cpp MutableLinkedContainer.cpp

# Object files to generate
Objects = $(Sources:.cpp=.o)

# compile executable files
$(TARGET): $(Objects)
	$(CXX) $(CXXFLAGS) -o $(TARGET) $(Objects)


# dependencies
main.o: main.cpp MutableArrayContainer.h MutableLinkedContainer.h
MutableArrayContainer.o: MutableArrayContainer.cpp MutableContainer.h
MutableLinkedContainer.o: MutableLinkedContainer.cpp MutableLinkedContainer.h LinkedNode.h MutableContainer.h
LinkedNode.o: LinkedNode.cpp LinkedNode.h 

clean:
	rm -rf $(Objects) $(TARGET)
